package com.ymttest.database.sqlwapper;

import java.util.List;

import com.ymt.core.tool.Logger;
import com.ymt.database.SqlManager;
import com.ymttest.database.model.Ymt_ProductDescConfigWord;
import com.ymttest.database.model.YmtProductsI;
import com.ymttest.utils.EnvSetup;

/************************************************************************************
 * @File name : Ymt_ProductDescConfigWordWapper.java
 * @Author : zhouyi
 * @Date : 2015年5月19日
 * @Copyright : 洋码头
 ************************************************************************************/
public class Ymt_ProductDescConfigWordWapper {
	SqlManager manage;

	public Ymt_ProductDescConfigWordWapper() {
		manage = new SqlManager("intpro");
	}

	

	public   Ymt_ProductDescConfigWord selectbyProductId(String productId) throws InterruptedException {
	    @SuppressWarnings("unchecked")
	    Ymt_ProductDescConfigWord Ymt_ProductDescConfigWord=new Ymt_ProductDescConfigWord();
	    List<Ymt_ProductDescConfigWord>  Ymt_ProductDescConfigWordlst = manage.getSelectResults(
	            "com.ymttest.database.mapping.Ymt_ProductDescConfigWordMapper.selectbyProductId", productId);
	    if(Ymt_ProductDescConfigWordlst.size()>0)
	    	Ymt_ProductDescConfigWord=Ymt_ProductDescConfigWordlst.get(0);
	    
	    return Ymt_ProductDescConfigWord;
	}
	
	
	public static void main(String args[]) {
	    try {
	    	Ymt_ProductDescConfigWordWapper Ymt_ProductDescConfigWordWapper = new Ymt_ProductDescConfigWordWapper();	                 
	          Ymt_ProductDescConfigWord rm = Ymt_ProductDescConfigWordWapper.selectbyProductId("af0c3f43-d98a-4593-93ba-e5c92f2d0107");
	      
	        	System.out.println("11:"+rm.getWordContent());
	        
	         
	    } catch (InterruptedException e) {
	        e.printStackTrace();
	    }
	}
	
	/**
	 * 关闭数据库连接
	 */
	public void close() {
		manage.close();
	}

	@Override
	protected void finalize() throws Throwable {
		this.close();
		manage = null;
		super.finalize();
	}


}
